package com.lws.framework.module.usercenter.bean;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.springframework.security.core.GrantedAuthority;

@Entity
@Table(name = "CAS_AUTHORITY_")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Authority implements GrantedAuthority {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    @Id
    @Column(name = "ID_")
    @GeneratedValue
    private Long id;

    @Column(name = "AUTHORITY_")
    private String authority;

    /**
     * 
     */
    public Authority() {
    }

    /**
     * @param authority
     */
    public Authority(String authority) {
        this.authority = authority;
    }

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @return the authority
     */
    @Override
    public String getAuthority() {
        return authority;
    }

    /**
     * @param name the authority to set
     */
    public void setAuthority(String authority) {
        this.authority = authority;
    }

}
